Performance Analysis


Posted by clins210 on 2020-11-17

Performance Analysis

Complexity theory

Space complexity

S(P) = c + Sp(l)
Run execution time

Time complexity

T(P) = c + Tp(l)
c = compiling time

lesat upper Bound: big-O

f(n) = O (g(n)) iff
∃ positive cons. and n0 =>
f(n) <= c g(n)
∀ n, n >= n0.

ex(1). 3n + 2 = O(n) 3n + 2 <= 4n, (n >= 2)
ex(2). 10n^2 + 4n + 2 = O(n^2) 10n^2 + 4n + 2 <= 11 n^2
ex(3). 3n + 2 = O(n^2) 3n + 2 <= n^2, (n >= 4)

most lower Bound: Ω

f(n) = Ω (g(n)) iff
∃ positive cons. and n0 =>
f(n) >= c g(n)
∀ n, n >= n0.

lesat upper Bound: Θ

f(n) = Θ (g(n)) iff
∃ positive cons. c1,c2,and n0 =>
c1 g(n) <= f(n) <= c2 g(n)
∀ n, n >= n0.


#complexity #Time #space #big-O #omega







Related Posts

邪魔歪道還是苦口良藥?Functional CSS 經驗分享

邪魔歪道還是苦口良藥?Functional CSS 經驗分享

Web開發學習筆記15 — 呼叫堆疊、同步與非同步、Promise、Async/Await、Conditional ternary operator

Web開發學習筆記15 — 呼叫堆疊、同步與非同步、Promise、Async/Await、Conditional ternary operator

程式基礎 —— Javascript 動手做 Part2

程式基礎 —— Javascript 動手做 Part2


Comments